﻿//公共部分
function stopBubble(e) {
    // 如果传入了事件对象，那么就是非ie浏览器
    if (e && e.stopPropagation) {
        //因此它支持W3C的stopPropagation()方法
        e.stopPropagation();
    } else {
        //否则我们使用ie的方法来取消事件冒泡
        window.event.cancelBubble = true;
    }
}
// 页面滚动wow.js再ie9以上引用
$(window).load(function() {
    var wow = new WOW({
        boxClass: 'wow',
        animateClass: 'animated',
        offset: 100,
        mobile: true,
        live: true
    });
    if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))) {
        wow.init();
    };
});




// 图像预加载

$.preloadImage=function(){
    for(var i=0;i<arguments.length;i++){
        $('<img>').attr('src',arguments[i])
    }
};
$.preloadImage('images/arr-demo-h.png');

$('img').load(function() {
   console.log('All images has load successful');
});

$('body').on("mousewheel DOMMouseScroll", function (event) {
    // chrome & ie || // firefox
    var delta = (event.originalEvent.wheelDelta && (event.originalEvent.wheelDelta > 0 ? 1 : -1)) ||
        (event.originalEvent.detail && (event.originalEvent.detail > 0 ? -1 : 1));  
    
    if (delta > 0) {
        console.log('mousewheel top');
    } else if (delta < 0) {
        console.log('mousewheel bottom');
    }
});

const arr1=[1,2,3];
const arr2=[...arr1]
console.log(arr2)